//
//  SATypeChooseColorCell.m
//  saasRetail
//
//  Created by 黄志刚 on 2021/7/23.
//

#import "SATypeChooseColorCell.h"
#import "SAStatisticalAddPayModel.h"

@interface SATypeChooseColorCell()

@property (weak, nonatomic)  UILabel *countLabel;

@end

@implementation SATypeChooseColorCell

-(instancetype)initWithFrame:(CGRect)frame
{
    if(self = [super initWithFrame:frame])
    {
        [self setUpsUbViews];
    }
    return self;
}

-(void)setUpsUbViews
{
    UILabel *countLabel = [[UILabel alloc] init];
    countLabel.textAlignment = NSTextAlignmentCenter;
    countLabel.font = kFont(14);
    countLabel.textColor = kColor(51, 51, 51, 1);
    self.countLabel = countLabel;
    [self addSubview:countLabel];
    [countLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(kScaleNum(80));
        make.left.mas_equalTo(0);
        make.height.mas_equalTo(kScaleNum(30));

    }];
}

-(void)payModel:(SAStatisticalAddPayModel *)model {
    
    self.countLabel.text = model.attrName;
    if (model.check == YES) {
        self.countLabel.backgroundColor = kPinkColor;
        self.countLabel.textColor = [UIColor whiteColor];
    }else {
        self.countLabel.backgroundColor = kBgColor;
        self.countLabel.textColor = kBlackColor;
    }
}

@end

